<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        input {
            border: 1px solid #d9d9d9;
            color: #aaa;
            outline: none;
        }
    </style>
</head>
<body>
    <input type="text" value="邮箱/ID/手机号">
    <!-- <input type="text" value="密码"> -->
    <button>登录</button>
    <script>
        var inp = document.querySelector('input');
        inp.onfocus = function (){
            inp.value = '';
            inp.style.border = '1px solid #ffd6db';
        }
        inp.onblur = function (){ 
            // inp.value = '邮箱/ID/手机号';
            inp.style.border = '1px solid #aaa';
            inp.style.color = '#aaa';
            if (inp.value.length == 0){
                inp.value = '邮箱/ID/手机号';
            }else {
                inp.style.border = '1px solid red';
            }
        }
    </script>
</body>
</html>